A modified particle swarm optimization rat search algorithm and its engineering application

Solar energy generation requires photovoltaic (PV) systems to be optimised, regulated, and simulated with efficiency. The performance of PV systems is greatly impacted by the fluctuation and occasionally restricted accessibility of model parameters, which makes it difficult to identify these characteristics over time. To extract the features of solar modules and build highly accurate models for PV system modelling, control, and optimisation, current-voltage data collecting is essential. To overcome these difficulties, the modified particle swarm optimization rat search algorithm is presented in this manuscript. The modified rat search algorithm is incorporated to increase the PSO algorithm’s accuracy and efficiency, which leads to better outcomes. The RSA mechanism increases both the population’s diversity and the quality of exploration. For triple diode model of both monocrystalline and polycrystalline, PSORSA has showed exceptional performance in comparison to other algorithm i.e. RMSE for monocrystalline is 3.21E-11 and for polycrystalline is 1.86E-11. Similar performance can be observed from the PSORSA for four diode model i.e. RMSE for monocrystalline is 4.14E-09 and for polycrystalline is 4.72E-09. The findings show that PSORSA outperforms the most advanced techniques in terms of output, accuracy, and dependability. As a result, PSORSA proves to be a trustworthy instrument for assessing solar cell and PV module data.


Overview
Increasing attention has been paid in recent years to the importance of simulating accurately solar PV cells.Two steps are involved in solar cell modelling, namely formulation of mathematical expressions and estimation of cell parameters.Several researchers have reported on a mathematical model derived from the data [1,2].Various models of PV cells are commonly used, such as the single diode (SD) model [3], the double diode (DD) model [4], and the three diode (TD) model [5].In order to use these models to calculate PV panel parameters, specific PV panel parameters need to be estimated.These parameters include saturation current (Id), series resistance (Rse), shunt resistance (Rsh), ideality factor (a), and photocurrent (I).In order to estimate the parameters of the SD, DD, or TD model, depending on the criteria chosen, there is a need to estimate five, seven, or nine parameters, respectively.It is crucial that the optimal values for the aforementioned parameters are determined in order to ensure that the chosen PV model produces outputs that are comparable to those of physical solar cells [6,7].

Techniques
Solar cells' parameters have been estimated using optimization algorithms in recent years.The deterministic techniques include Lambert W-functions, least squares, and curve fitting.Because of the parameters' differentiability and convexity, deterministic methods have several restrictions.Since these techniques are highly sensitive to the initial solution, they tend to arrive at a local minimum rather than the global optimum [8,9].A heuristic method is introduced as an alternative to the deterministic method, and it has been proven that heuristics methods can produce more accurate and robust results [10].There are a variety of heuristic methods that are based on population data and are derived from nature [11].The use of heuristics is a common application in engineering whereby the use of these algorithms can be used to solve challenges such as differentiability and convexity without the need to address these specific aspects.Several advantages can be gained from using these heuristic methods when attempting to estimate the parameters of solar PV cells.Over the past few years, various heuristic methods have been developed and utilized for the purpose of enhancing the efficiency of these methods.In addition to particle swarm optimization (PSO), genetic algorithms [12], teaching-learning optimization (TLO) [13], cuckoo search (CS) [14], artificial bee colonies (ABCs) [15], Rao-1 [16], and Jaya algorithm [17], there are other notable algorithms.It has been reported that these methods have been successfully applied in the field in many instances by researchers.Table 1 shows the latest optimization techniques used by various researchers to estimate the unknown parameters of solar PV diode model.

Observation
In spite of their effectiveness and speed, heuristic algorithms have few limitations when compared to traditional techniques.Due to the exclusive searching mechanism of PSO and GA, these methods primarily focus on local minima, resulting in a high probability of premature convergence for multi-modal systems.While CS and ABC are effective when exploring at the initial exploration stage, they tend to be slow to achieve convergence once the exploration stage is complete.The result is that when these methods are applied to multi-objective functions, they tend to perform poorly as a result.As a result of the fact that the objective function is derived from noisy raw data, most heuristic algorithms do not perform optimally when applied to noisy raw data.A heuristic approach was needed to address the problem of estimating the parameters of solar PV cells, which aimed to strike a balance between local and global search capabilities using a heuristic method [32].It has been found that a single diode model incorporating a series resistance can be enhanced in terms of efficiency by adding a series resistance.In order to implement the proposed algorithm, we will take advantage of both three diode and four diode models of solar PV cells, thereby utilizing a new algorithm for parameter estimation.The motivation of the manuscript is to develop a metaheuristic algorithm is can estimate the unknown parameters accurately and can used to sole more complex mathematical model with ease and accuracy.The new algorithm consists of hybridization of PSO as well as RSA algorithm which eliminates the drawback of struck in local minima, therefore estimating the precise value of unknown parameters.
There are a number of major contributions made in this paper, which can be summed up as follows: • The hybrid (PSORSA) algorithm is justified through five benchmark CEC2019 test functions, and the average and Standard Deviation (SD) are calculated for each of them.
• Solar PV cell parameters are estimated at standard temperature condition and Root Mean Square Error (RMSE) is compared with other standalone algorithms.
• The non-parametric test is performed i.e., Friedman Ranking Test and Wilcoxon's Rank Sum Test.

Solar PV cell model mathematical modelling and problem formulation
In order to model a PV cell, there are two primary steps that need to be followed.The first step in the research process is to formulate the mathematical model that represents the PV cell.In the subsequent step, parameters are estimated to determine the specific values for the model's parameters.Single diode (SD) and double diode (DD) models are among the most frequently explored and reported PV models.To understand and analyze the behavior of solar PV cells, these models serve as fundamental building blocks.

Solar PV cell mathematical modelling
Enhancing parameter extraction: A comprehensive analysis of the three-diode model for PV Cells.When it comes to modeling solar PV cells, three diode models offer an improvement over double diode models.In Fig 1, three diodes are illustrated operating within the equivalent circuit model with three diodes.I dc3 represents leakage currents and grain boundaries, which are taken into consideration in this model.Using the three-diode equivalent circuit model as an example, leakage current is flowing through the shunt resistance, which is attached to the diode equivalent circuit.In addition, it should be mentioned that the semiconductor-to-substrate resistance in solar PV cells is a representation of the series resistance within the fundamental region.It is through the incorporation of these factors that the three-diode model is able to provide a more accurate and comprehensive representation of the behavior of solar PV cells.Eq 1 illustrates the modelling of three diodes.
The curve fitting accuracy of a three-diode solar PV cell is high, and it is possible to determine the different components of the solar PV cell's current.However, its modeling is extremely complex.The I-V characteristics of silicon solar cells of large area are simulated using this model.

Enhancing parameter extraction: A comprehensive analysis of the four-diode model for PV Cells.
There are several advantages of using four diode equivalent circuits for the analysis of industrial solar PV cells over single, double, and triple diode models.Compared with other curve fitting algorithms, this software exhibits higher accuracy with minimal error between experiments and calculations, superior curve-fitting capabilities, and excellent performance under the STC algorithm.As a consequence, this model comes with a high level of complexity, which is a notable drawback.There are a number of factors that need to be taken into account when describing the characteristics of solar PV cells in large industrial applications, where PV cell sizes exceed 155.2 cm 2 and solar PV cell efficiency is 17.1%, and the parameters I dc1 and I dc2 do not adequately represent solar PV cell characteristics A four-diode equivalent circuit is shown in Fig 2.
Modelling of four-diode model is represented in the Eq 2: In the following formula, I o is the output current, V o is the output voltage, I ph is the photocurrent.I rsd1 , I rsd2 , I rsd3 , I rsd4 represent the reverse saturation currents of the four diodes, and q represents the absolute amount of current flowing through them.Assume that the ideal factors are n 1 , n 2 , n 3 , n 4 ; K is the Boltzmann's constant; and T is the absolute temperature of the P-N junction (in Kelvin).

Problem formulation
An optimization technique helps identify unknown parameters and experimental I-V data for the real system.Based on the four-diode model of solar PV cells, vector defines the solution of the optimization algorithm where x ¼ ½R se R sh I ph I rsd1 I rsd2 I rsd3 I rsd4 n 1 n 2 n 3 n 4 �.In order to minimize the error between measured currents and calculated currents, parameters of solar PV cells are estimated.In homogeneous form, Eqs 1 and 2 can be rewritten as Eqs 3 and 4 to define the objective function, and for the experimental data, the value of can be calculated.
For evaluating the difference between measured and calculated currents, Root Mean Square Error (RMSE) is used.RMSE can be calculated using Eq 5.

RMSE ¼
ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi 1 N This equation is based on an N number of measured data and an x number of solution vectors.To reduce the value of RMSE, parameter estimation of solar PV cells is therefore the key objective.

Enhancing efficiency with the Rat Search Algorithm (RSA)
This study focuses on analyzing the intelligence and social interactions of rats from two different species, and explores the behavioral characteristics of these rats.The different sizes and weights of these rats are examined in order to gain insight into the activities they are involved with within their territorial communities on a daily basis.In addition to grooming, tumbling, hopping, boxing, and chasing, other activities are included in this type of activity.As a result, rats may display violent behavior when competing for prey, leading to the death of some rats during such competitions.The primary objective of this study is to develop a mathematical model of aggressive behavior among rats during chases and battles, which may provide an accurate representation of the behavior of rats during such situations.
Mathematical Modeling: Advancing precision in practical applications.Unraveling the pursuit strategies of living creatures: Chasing.There is evidence that social agonistic behaviors are displayed by animals, such as rats, when they hunt for prey in groups.It is important to note that when we mathematically model this process, we assume that the most effective search agent already knows the location of the prey when the search starts.Upon detecting the movement of the best search agent, the other search agents adjust their positions accordingly.A mathematical Eq 6 is introduced in this study in order to elucidate this mechanism.
The position of the rat is represented as Q j �! ðzÞ, and the best optimal solution is denoted as As a result of Eq 7 and Eq 8, B and D are determined.
Where; z ¼ 0; 1; 2; . . .::; Max iter : ð7Þ Random numbers are generated from two parameters, S and D, in the iterative process.Parameter S has values between 0 and 2, while parameter D has values between 1 and 5. B and D play vital roles in enhancing the efficiency of the exploration and exploitation stages by optimizing the performance of these parameters.
Fighting: Understanding the aggressive behavior of organisms.Rats battle their prey mathematically using Eq 9 to represent the battles they engage in.Rats likely behave aggressively when confronted by their prey during aggressive encounters described by this equation.
The rat search algorithm employs equation

PSORSA: A potent hybrid of particle swarm optimization and rat search algorithm
In this paper, we propose a hybrid approach that combines two algorithms in order to significantly improve efficiency.With the integration of PSO with RSA, a precursor algorithm to swarm algorithms, we improve RSA's precision.By using the hybrid method, the system is not trapped in local minimums, and it achieves a higher degree of accuracy, resulting in faster operation and the ability to reach the global optimum more quickly.By combining RSA and PSO, we are able to create a powerful hybrid optimization approach.Moreover, as we do not need substantially more computation power to achieve the desired results, our hybrid method proves to be highly costeffective.For optimizing the system, RSA and PSO can be combined to provide a powerful and cost-effective solution.

Benchmark test functions
Five benchmark test functions from CEC 2019 are selected to validate the effectiveness of the newly designed algorithm.Table 2 shows the parameters of the algorithm which form the biases for test.As shown in Table 3 these features have dimensions of 20 and 40, with f 1 to f 5 being CEC functions.This paper compares PSO, CSA, SCA, RSA, GWO, HBO, PF and PSORSA metaheuristics algorithms to check the performance of proposed algorithms.In order to make a fair comparison between 5 benchmark test functions and other algorithms compared, a limit of 1000 feature evaluations per function is set.Codes were programmed in MATLAB 2018b and each algorithm was run 30 times independently.Tables 4 and 5 show the average and standard deviations with dimension of 20 and 40 of five benchmark tests obtained by the algorithms.The results of Tables 4 and 5 indicate that the proposed algorithm is more efficient than the others.Comparing the proposed algorithm with the other algorithms, the proposed algorithm is able to demonstrate a lower mean and standard deviation value across five benchmark test functions when compared with the other algorithms.We can conclude from these results from the benchmark test function that the hybrid algorithm that has been proposed outperforms the existing algorithms in terms of convergence rate, robustness, precision, and overall performance as compared to the other algorithms.Therefore, the hybrid algorithm offers better results than the rest and should be used for optimization purposes.It is a reliable and efficient algorithm for solving complex problems.

Engineer problem (Parameter extraction of solar cells)
In this section, proposed algorithm addresses parameter extraction issues for two distinct solar PV models to facilitate a deeper analysis of their performance.The specifications of two solar   Like the Nemy panel, it also consists of 60 cells and is rated for a temperature of 25˚C.From these two solar panels the parameter extraction of three and four diode model is done.The first parameter is Ipv, which has a lower bound of 0 and an upper bound of 1 (measured in Amperes).The next four parameters, namely Irsd1, Irsd2, Irsd3, and Irsd4, are measured in microamperes (μA) and have a lower bound of 0 and an upper bound of 1.The parameter Rse, measured in Ohms (O), has a lower bound of 0 and an upper bound of 0.5.The parameter Rsh, also measured in Ohms (O), has a lower bound of 0 and an upper bound of 100.The last set of parameters, n 1 , n 2 , n 3 , and n 4 , are unit less and have a lower bound of 1 and an upper bound of 2. In this section two cases are discussed first one is mono-crystalline and poly-crystalline solar panels.Case 1: Mono-crystalline solar panel.In this case the solar panel is considered as Nemy which is mono-crystalline.In this the parameter extraction of three diode and four diode model is presented.Tables 6 and 7 represents the unknown parameter of both the solar models with respective to error (RMSE).The Fig 6 represents the RMSE error of both the models.From these both table and figure it is concluded that the proposed hybrid algorithm is far better than the compared algorithm.The hybrid algorithm is far better than the standalone algorithm with respect to convergence time, reliability, and memory etc.After the extraction of both the models the Friedman ranking test [40][41][42][43][44] Table 8 and Wilcoxon's rank sum test [45][46][47][48][49][50][51] Table 9 is performed and from this test also it is concluded that the proposed hybrid algorithm is far better than the rest of the compared standalone algorithms.Case 2: Poly-crystalline solar panel.In this case the solar panel is considered as solar world which is poly-crystalline.In this the parameter extraction of three diode and four diode model is presented.Tables 10 and 11 represents the unknown parameter of both the solar models with respective to error (RMSE).The Fig 7 represents the RMSE error of both the models.From these both table and figure it is concluded that the proposed hybrid algorithm is far better than the compared algorithm.The hybrid algorithm is far better than the standalone algorithm with respect to convergence time, reliability, and memory etc.After the extraction of both the models the Friedman ranking test Table 12 and Wilcoxon's rank sum test Table 13 is performed and from this test also it is concluded that the proposed hybrid algorithm is far better than the rest of the compared standalone algorithms.

Conclusion
The goal of this research is to introduce a novel hybrid algorithm, PSORSA, which will assist in addressing global optimization challenges and extracting solar cell parameters under varying temperatures.PSORSA is a meta-heuristic algorithm that merges two meta-heuristic algorithms, PSO and RSA, to strike a balance between exploring new ideas and exploitation existing ideas.The approach incorporates the opposition-based learning approach, which can be used to enhance the diversity of demographic groups.In order to conduct this study, two solar PV cell models, namely Nemy-JP270M60 and Solar World-SW80RNA, are used, which are mathematically equivalent models of PV cells with three and four diodes.Following are some of the results that have been obtained as a result of this investigation: • It has been shown that PSORSA is far superior to other algorithms when it comes to achieving precise solutions and achieving faster convergence when it comes to global optimization problems.
• It can be concluded that PSORSA performs better than any of the other techniques in terms of consistency in solutions, as well as equivalent efficiency, when compared to Friedman ranking and Wilcoxon's rank-sum tests.
• Statistically, both PV models are more effectively managed using PSORSA than they are when extracting parameters for them via a regression analysis.
There is no doubt that the findings of the study establish PSORSA as an effective and promising method for extracting solar PV cell parameters.It is important to note that PSORSA can be applied to a variety of other energy optimization challenges, in addition to solar PV cell parameters, making it an ideal tool for tackling others.The system could be used in the power system arena to address issues such as optimal distributed generation configuration, economic

Fig 2 .
Fig 2. Efficient representation of PV circuit with four diodes.https://doi.org/10.1371/journal.pone.0296800.g002 to update the rat's next position, ensuring the retention of the optimal solution while adjusting the positions of other search agents accordingly.The parameters B and D are appropriately adjusted to promote effective exploration and exploitation.RSA (Rat Search Algorithm) introduces a solution achievable with a minimal number of operators.Fig 3 presents the pseudo-code for the rat search algorithm, and Fig 4 illustrates the flow chart of the algorithm.
Fig 5 illustrates the flow chart of this hybrid algorithm.

Table 2 . Algorithm parameters.
https://doi.org/10.1371/journal.pone.0296800.t002panels from different companies, namely Nemy and Solar World.The first panel is the JP270M60 model from Nemy, which uses mono-crystalline cells.It has a Vm (voltage at maximum power) of 31.10V,Im (current at maximum power) of 8.68A, Voc (open circuit voltage) of 38.60V, and Isc (short circuit current) of 9.20A.The panel consists of 60 cells and is rated for a temperature of 25˚C.The second panel is the SW80RNA model from Solar World, which uses poly-crystalline cells.It has a Vm of 17.90V, Im of 4.49A, Voc of 21.90V, and Isc of 4.78A.

Table 12 . Friedman ranking test of both the models.
https://doi.org/10.1371/journal.pone.0296800.t012load dispatch, and energy scheduling problems, potentially providing greater chances of achieving successful outcomes in those areas.